<template>
	<view id="wrap">
		<u-parse :content="content"></u-parse>
	</view>
</template>

<script>
export default {
	data() {
		return {
			titList: ['用户协议', '隐私协议', '关于我们'],
			type: 0,//(1-登录页文案 2-关于我们 3-隐私协议 4-用户协议 5-购买协议)
			content: '',
		}
	},
	methods: {
		getInfo() {
			this.$api.getAgreement({ name: this.titList[this.type - 1] }).then(res => {
				console.log('协议res', res);
				this.content = res.data[0].content
			})
		}
	},
	onLoad(options) {

		this.type = Number(options.type)
		uni.setNavigationBarTitle({
			title: this.titList[this.type - 1]
		})
		this.getInfo()
	}
}
</script>

<style lang="scss" scoped>
#wrap {
	padding: 30rpx;
}
</style>